<template>
  <div class="page_box">
    <div>
      <el-input v-model="password"></el-input>
      <el-button @click="secret(password)">加密</el-button>
      <el-button @click="parse()">加密</el-button>
      <div>原值：{{ oldValue }}</div>
      <div>加密后的值：{{ secretValue }}</div>
      <div>解密后的值：{{ parseValue }}</div>

    
    </div>
  </div>
</template>

<script>
import { encrypt, decrypt } from "./jsencrypt.js";
export default {
  data() {
    return {
      password: "",
      oldValue: "",
      secretValue: "",
      parseValue: "",
    };
  },
  methods: {
    secret(value) {
      this.oldValue = value;
      this.secretValue = encrypt(value);
    },
    parse() {
      this.parseValue = decrypt(this.secretValue);
    },
  },
};
</script>

<style></style>
